/*
 * Copyright (C) 2009 Dimitrios C. Michalakos
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.cs.util.db;

import java.sql.SQLException;

/**
 * ResultSetMetaInfo is an interface. It can be used to create classes that get information about the types and properties of the columns of a table or resultset.
 * ResultSetMetaInfo is our proposal of what ResultSetMetaData should be.
 * @author dimitris@jmike.gr
 */
public interface ResultSetMetaInfo {

    public boolean containsColumn(String column);

    public int getColumnCount();

    public int getPosition(String column) throws SQLException;

    public int getPosition(String table, String column) throws SQLException;

    public String[] getColumnArray();

    public String getColumn(int position) throws SQLException;

    public String[] getTableArray();

    public String getTable(int position) throws SQLException;

    public String getTable(String column) throws SQLException;

    public DatatypeEnum getDatatype(int position) throws SQLException;

    public DatatypeEnum getDatatype(String column) throws SQLException;

    public boolean isSigned(String column) throws SQLException;

    public boolean isSigned(int position) throws SQLException;

    public long getSize(String column) throws SQLException;

    public long getSize(int position) throws SQLException;

    public int getIntegerDigits(String column) throws SQLException;

    public int getIntegerDigits(int position) throws SQLException;

    public int getFractionalDigits(String column) throws SQLException;

    public int getFractionalDigits(int position) throws SQLException;

    public String getDefaultValue(String column) throws SQLException;

    public String getDefaultValue(int position) throws SQLException;

    public String getPossibleValues(String column) throws SQLException;

    public String getPossibleValues(int position) throws SQLException;

    public boolean isPrimaryKey(String column) throws SQLException;

    public boolean isPrimaryKey(int position) throws SQLException;

    public boolean isNullable(String column) throws SQLException;

    public boolean isNullable(int position) throws SQLException;

    public boolean isAutoIncremented(String column) throws SQLException;

    public boolean isAutoIncremented(int position) throws SQLException;
}
